//
//  HEDocOrderInfoCell.m
//  HealthFamily
//
//  Created by 吴欧 on 2020/11/18.
//  Copyright © 2020 honglutec. All rights reserved.
//

#import "HEDocOrderInfoCell.h"
#import "HEServerComfireModel.h"

@interface HEDocOrderInfoCell ()

@property (nonatomic, strong) UILabel *titleLb;
@property (nonatomic, strong) UILabel *contentLb;

@end

@implementation HEDocOrderInfoCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        [self initUI];
        self.qmui_borderPosition = QMUIViewBorderPositionBottom;
        self.qmui_borderWidth = 1;
        self.qmui_borderColor = CSplitLineColor;
    }
    return self;
}

- (void)initUI {
    // 姓名
    _titleLb = [UILabel new];
    _titleLb.text = @"-";
    _titleLb.font = DYBlodFont(18);
    [self.contentView addSubview:_titleLb];
    
    // cans
    _contentLb = [UILabel new];
    _contentLb.text = @"-";
    _contentLb.font = DYBlodFont(18);
    _contentLb.numberOfLines = 0;
    _contentLb.textAlignment = NSTextAlignmentRight;
    [self.contentView addSubview:_contentLb];
    
    [_titleLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).mas_offset(15);
        make.left.equalTo(self.contentView).mas_offset(15);
        make.right.equalTo(_contentLb.mas_left).mas_offset(-40);
//        make.bottom.equalTo(self.contentView).mas_offset(-15);
    }];
    [_titleLb setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
    
    [_contentLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).mas_offset(15);
        make.left.equalTo(_titleLb.mas_right).mas_offset(15);
        make.right.equalTo(self.contentView).mas_offset(-15);
        make.bottom.equalTo(self.contentView).mas_offset(-15);
    }];
}

- (void)configCellWithModel:(HEServerComfireModel *)model fiterModel:(GDFiterCellModel *)fiterModel indexPath:(NSIndexPath *)indexPath {
    _titleLb.text = fiterModel.leftTitle;
    _contentLb.text = model.payParams[indexPath.row];
    
    _titleLb.textColor = fiterModel.leftTitleColor;
    _contentLb.textColor = fiterModel.contentColor;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

@end
